package com.yanfan.permission.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.yanfan.common.annotation.Excel;
import com.yanfan.common.core.domain.BaseEntity;

/**
 * 存储API认证信息的，用于管理不同API的认证信息对象 api_credentials
 *
 * @author kerwincui
 * @date 2024-08-12
 */
public class ApiCredentials extends BaseEntity
{

    private static final long serialVersionUID = 1L;

    /** 自增主键，唯一标识每条记录 */
    private Long id;

    /** API名称，用于标识认证信息属于哪个API */
    @Excel(name = "API名称，用于标识认证信息属于哪个API")
    private String apiName;

    /** 认证类型：账号密码、应用ID和密钥、令牌 */
    @Excel(name = "认证类型：账号密码、应用ID和密钥、令牌")
    private String authType;

    /** 账号名称，如果认证类型是账号密码 */
    @Excel(name = "账号名称，如果认证类型是账号密码")
    private String username;

    /** 密码，建议在应用层加密后存储 */
    @Excel(name = "密码，建议在应用层加密后存储")
    private String password;

    /** 应用ID，如果认证类型是应用ID和密钥 */
    @Excel(name = "应用ID，如果认证类型是应用ID和密钥")
    private String appId;

    /** 应用密钥，建议在应用层加密后存储 */
    @Excel(name = "应用密钥，建议在应用层加密后存储")
    private String appSecret;

    /** 认证令牌，如果认证类型是令牌 */
    @Excel(name = "认证令牌，如果认证类型是令牌")
    private String token;

    /** 记录创建时间，默认值为当前时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录创建时间，默认值为当前时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 记录更新时间，自动更新为最新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录更新时间，自动更新为最新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    /** 备注信息，可存储额外说明或信息 */
    @Excel(name = "备注信息，可存储额外说明或信息")
    private String remarks;

    /**
     * 加密类型：0-MD5加密，1-AES加密
     */
    private int encryptType;

    public int getEncryptType() {
        return encryptType;
    }

    public void setEncryptType(int encryptType) {
        this.encryptType = encryptType;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setApiName(String apiName)
    {
        this.apiName = apiName;
    }

    public String getApiName()
    {
        return apiName;
    }
    public void setAuthType(String authType)
    {
        this.authType = authType;
    }

    public String getAuthType()
    {
        return authType;
    }
    public void setUsername(String username)
    {
        this.username = username;
    }

    public String getUsername()
    {
        return username;
    }
    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getPassword()
    {
        return password;
    }
    public void setAppId(String appId)
    {
        this.appId = appId;
    }

    public String getAppId()
    {
        return appId;
    }
    public void setAppSecret(String appSecret)
    {
        this.appSecret = appSecret;
    }

    public String getAppSecret()
    {
        return appSecret;
    }
    public void setToken(String token)
    {
        this.token = token;
    }

    public String getToken()
    {
        return token;
    }
    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }

    public String getRemarks()
    {
        return remarks;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("apiName", getApiName())
            .append("authType", getAuthType())
            .append("username", getUsername())
            .append("password", getPassword())
            .append("appId", getAppId())
            .append("appSecret", getAppSecret())
            .append("token", getToken())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .append("remarks", getRemarks())
            .toString();
    }
}
